/*  This file is part of -_-.

    -_- is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    -_- is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with -_-.  If not, see <http://www.gnu.org/licenses/>.

    Copyright 2012 Oliver Katz */

#ifndef __VISUAL_LAYOUT_ENGINE_H
#define __VISUAL_LAYOUT_ENGINE_H

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <sstream>

using namespace std;

namespace sleepyface
{
	namespace visual
	{
		namespace layout_engine
		{
			class Widget;

			class Container
			{
			private:
				string name;
				vector<pair<bool, pair<Widget, Container> > > branches;
				map<string, int> ivalues;
				map<string, string> svalues;

			public:
				Container();
				Container(string n);
				string getName();
				string setName(string n);
				int appendContainer(Container c);
				int appendWidget(Widget w);
				int size();
				bool isContainer(int idx);
				bool isWidget(int idx);
				Container getContainer(int idx);
				Widget getWidget(int idx);
				bool isValue(string k);
				bool isInt(string k);
				bool isString(string k);
				int getInt(string k);
				int setInt(string k, int v);
				string getString(string k);
				string setString(string k, string v);
				string display(int n);
				string display();
			};

			class Widget
			{
			private:
				string name;
				string type;
				map<string, int> ivalues;
				map<string, string> svalues;

			public:
				Widget();
				Widget(string n, string t);
				string getName();
				string setName(string n);
				string getType();
				string setType(string t);
				bool isValue(string k);
				bool isInt(string k);
				bool isString(string k);
				int getInt(string k);
				int setInt(string k, int v);
				string getString(string k);
				string setString(string k, string v);
				string display(int n);
				string display();
			};
		}
	}
}

#endif